import {GATEWAY_AXIOS} from './axios.js'

// GET - 查询全部记录
export function listApi() {
    return GATEWAY_AXIOS.get('/employee/api/v1/role/list');
}

// POST - 分页查询记录
export function pageApi(params) {
    return GATEWAY_AXIOS.post('/employee/api/v1/role/page', params);
}

// POST - 添加一条记录
export function saveApi(params) {
    return GATEWAY_AXIOS.post('/employee/api/v1/role/save', params)
}

// PUT - 修改一条记录
export function updateApi(params) {
    return GATEWAY_AXIOS.put('/employee/api/v1/role/update', params)
}

// POST - 删除一条记录
export function removeApi(id) {
    return GATEWAY_AXIOS.delete('/employee/api/v1/role/remove/' + id);
}

// POST - 批量删除记录
export function removeBatchApi(ids) {
    return GATEWAY_AXIOS.delete('/employee/api/v1/role/batchRemove?ids=' + ids);
}

// GET - 根据角色ID查询该角色的全部菜单
export function listMyMenusApi(empId) {
    return GATEWAY_AXIOS.get('/employee/api/v1/role/listMenus/' + empId);
}

// PUT - 根据角色ID和menuIds修改该角色的菜单
export function updateMyMenusApi(params) {
    return GATEWAY_AXIOS.put('/employee/api/v1/role/updateRoleMenus', params);
}